Today's world of computer programming offers many high-level programming languages. Java.TM., for example, has achieved widespread use in a relatively short period of time and is largely attributed with the ubiquitous success of the Internet. The popularity of Java is due, at least in part, to its platform independence, object orientation and dynamic nature. In addition, Java removes many of the tedious and error-prone tasks which must be performed by an application programmer, including memory management and cross-platform porting. In this manner, the Java programmer can better focus on design and functionality issues.
Although it is desirable to take advantage of Java's software portability, so that software applications may easily be moved to another environment, there are a number of reasons why a programmer may desire to access platform dependent native code. While most applications can be written entirely in Java, there are situations where Java alone does not meet the needs of an application. For example, it may be desirable to implement time-critical or computationally intensive tasks in another programming language, such as C, C++, FORTRAN or Assembly. In addition, a company's institutional investment in existing native software routines may make it too expensive to reimplement the native routines in Java.
Programmers currently use the Java Native Interface (JNI) to write Java native methods (classes) to handle those situations where an application cannot be written entirely in Java. The JNI is a programming interface implemented as part of the Java Developer's Kit (JDK) that allows Java code to interoperate with applications and libraries written in other languages, such as C, C++, FORTRAN and Assembly. Even with the Java Native Interface, however, significant man-hours of programming effort are required to implement native methods and to access native data structures from Java. Furthermore, programming with the Java Native Interface is not for the inexperienced programmer. Thus, experienced programming talent must undertake the tedious task of JNI programming, thereby substantially increasing development costs.
Currently, the implementation of native methods and data structures in Java using the Java Native Interface is a labor-intensive manual process. As with any manual programming task, it is quite likely that each programmer would implement the same native method differently, in accordance with personal preferences and programming styles. Inconsistent implementations, however, dramatically increase the ongoing costs of software maintenance and software extension. In addition, unless the native method is implemented by an experienced programmer, the implementation is likely to be error-prone.
As apparent from the above-described deficiencies with conventional techniques for making native code accessible to Java applications, a need exists for an automated technique for making native code accessible to Java applications that provides consistent, reliable and maintainable Java Native Interface code. A further need exists for an improved technique for converting complex data types.